import request from '@/utils/request'
export function getRepresentList(page, keyword) {
  return request({
    url: '/back/represent/represent',
    method: 'get',
    params: { type: 'list', page, keyword }
  })
}
export function checkFeedBack(id) {
  return request({
    url: '/back/represent/represent',
    method: 'get',
    params: { type: 'lookFeedback', id }
  })
}
export function getPendingApproveList({ page, status, keyword }) {
  return request({
    url: '/back/represent/represent',
    method: 'get',
    params: { type: 'checkImageList', page, status, keyword }
  })
}
export function passOrNopass({ my_type, id, remark }) {
  return request({
    url: '/back/represent/represent',
    method: 'post',
    params: { type: 'updateStatus', my_type, id, remark }
  })
}
// 退款审批
export function getRefundList({ page, status, keyword }) {
  return request({
    url: '/back/represent/represent',
    method: 'get',
    params: { type: 'refundApplyRecord', page, status, keyword }
  })
}
export function modificationRefound({ id, myType, message, remit_file }) {
  return request({
    url: '/back/represent/represent',
    method: 'post',
    data: { type: 'updateRefundApplyStatus', id, myType, message, remit_file }
  })
}
export function setRules(represent_commodity_rule) {
  return request({
    url: '/back/represent/represent',
    method: 'post',
    data: { represent_commodity_rule, type: 'set' }
  })
}
export function getRules() {
  return request({
    url: '/back/plat/setRule',
    method: 'post',
    data: { type: 'list' }
  })
}
// 代言订单管理
export function getRepresentOrderList({ page, order_status, order_no, start_time, end_time }) {
  return request({
    url: '/back/represent/represent',
    method: 'get',
    params: { type: 'orderList', page, order_status, order_no, start_time, end_time }
  })
}
// 订单详情
export function getOrderDetail(id) {
  return request({
    url: '/back/represent/represent',
    method: 'get',
    params: { type: 'lookOrderInfo', id }
  })
}
// 发货
export function setDeliver({ id, logistics_name, logistics_number }) {
  return request({
    url: '/back/represent/represent',
    method: 'post',
    params: { type: 'delivery', id, logistics_name, logistics_number }
  })
}
export function getDeliverType() {
  return request({
    url: '/back/logistics',
    method: 'get',
    params: { type: 'list' }
  })
}
export function closeOrder(id) {
  return request({
    url: '/back/represent/represent',
    method: 'post',
    params: { type: 'updateOrderStatus', id, myType: 5 }
  })
}
// 备注
export function setRemark({ id, message }) {
  return request({
    url: '/back/represent/represent',
    method: 'post',
    params: { type: 'updateOrderStatus', myType: 2, id, message }
  })
}
// 修改订单状态
export function amendOrderStatus({ id, myType }) {
  return request({
    url: '/back/represent/represent',
    method: 'post',
    params: { type: 'updateOrderStatus', id, myType }
  })
}
